local StoryBehavior = require("gameLogic.story.behavior.StoryBehavior")
local StoryComposite = class("StoryComposite", StoryBehavior)

function StoryComposite:ctor()
    StoryComposite.super.ctor(self)
    self._children = {}
end

function StoryComposite:tick()
    if self:isDone() then
        return
    end
    if #self._children == 0 then
        self:setDone(true)
        return
    end
    self:_active()
end

function StoryComposite:addChild(child)
    table.insert(self._children, child)
end

return StoryComposite
